package com.google.code.jdbexport.datatypeconverter;



public abstract class AbstractJDBExportFormat <T>  {
	  
	  private T value;
	  
	  public AbstractJDBExportFormat(T vaule) {
		this.value = vaule;
	}
	  
	  public T getValue() {
		  return value;
	  }

	public String getSQL() {
		  
		  if (isNull()) {
			  return "null";
		  }
		  
		  String sql = buildSQL();
		  
		  if (sql == null || "NULL".equalsIgnoreCase(sql))  {
			  return "null";
		  }
		  
		  return sql ;
	  }

	public boolean isNull() {
		return value == null;
	}
	  
	protected abstract String buildSQL();
	  
	  
}

